﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
using System.IO;

namespace FileArchive
{
    public class Document : IDisposable
    {
        public Image Image { get; private set; }
        public Document(Stream s)
        {
            try
            {
                this.Image = System.Drawing.Image.FromStream(s, true);
            }
            catch (Exception)
            {
                this.Image = Resource.Generic_Document.ToBitmap();
            }
        }

        public Document()
        {
        }

        public void Dispose()
        {
            if (Image != null)
                Image.Dispose();
        }
    }
}
